package com.ormlite.activity.tool.button.event;

import android.app.Activity;
import android.view.View;

import com.ormlite.activity.check.CheckEventActivity;
import com.ormlite.activity.tool.DatabaseUtils;
import com.ormlite.pojo.Event;

public class RemoveEventButton implements View.OnClickListener {

	private final Activity checkEventActivity;
	private final Event event;

	public RemoveEventButton(CheckEventActivity checkEventActivity, Event event) {
		this.checkEventActivity = checkEventActivity;
		this.event = event;
	}

	@Override
	public void onClick(View v) {
		DatabaseUtils.removeEvent(event);
		checkEventActivity.finish();
		checkEventActivity.startActivity(checkEventActivity.getIntent());
	}

}
